<template>
  <div class="dailySpecial">
    <div
      class="dailySpecial-top"
      style="
        background-image: url('https://p1.music.126.net/x44v5IkLN30gWgUYWYivbg==/109951164000997664.jpg?param=140y140');
      "
    >
      <router-link tag="div" to="/home" class="left">
        <span class="iconfont icon-arrow-left-bold"></span>
      </router-link>
      <div class="rigth">
        <div class="pinjia"><i class="iconfont icon-kaixin"></i> 日推评价</div>
        <span class="iconfont icon-gengduo"></span>
      </div>
    </div>
    <div class="infoss">
      <div class="bg"></div>
      <div class="datas">
        <div class="datas-left">
          <div class="month">
            <div class="day">13</div>
            <div class="Luna">/ 07</div>
          </div>
          <div class="text">查看今天运势></div>
        </div>
        <div class="datas-rigth">历史日推</div>
      </div>
    </div>
    <van-sticky :offset-top="40">
      <div class="playerAll">
        <div class="btn">
          <span class="iconfont icon-bofang"></span>
        </div>
        <h3 @click="pressAll">播放全部</h3>
      </div>
    </van-sticky>
    <!-- 播放列表 -->
    <ul class="listsData" v-for="item in recommend" :key="item.id">
      <li @click="press(item.id)">
        <div class="left">
          <div class="img">
            <img :src="item.al.picUrl + '?param=140y140'" />
          </div>
          <div class="liss">
            <div class="lisstop">{{ item.name }}</div>
            <div class="lissbottom">
              <span class="spa">SQ</span>
              <div class="mim">
                {{ item.ar[0].name }} <span>-{{ item.name }}</span>
              </div>
            </div>
          </div>
        </div>
        <div class="rigths iconfont icon-gengduo"></div>
      </li>
    </ul>
  </div>
</template>

<script>
import { grtdailySpecial } from "../api/song";
export default {
  data() {
    return {
      recommend: null,
    };
  },
  methods: {
    grtdailySpecialFun() {
      grtdailySpecial().then((data) => {
        // console.log(data, "每日推荐");
        this.recommend = data.data.dailySongs;
        // console.log(this.recommend);
      });
    },
    press(id) {
      this.$emit("get-player-id", id);
      // console.log("切歌");
    },
    pressAll() {
      this.$emit("get-player-id", this.recommend[0].id);
    },
  },

  //生命钩子已创建
  created() {
    // console.log("aaa")
    this.grtdailySpecialFun();
  },
};
</script>

<style lang="less" >
.dailySpecial {
  width: 100%;
  height: 200%;
  .dailySpecial-top {
    position: fixed;
    top: 0px;
    left: 0px;
    // margin-top: 5px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    display: flex;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.3);
    background-size: 10000%;
    justify-content: space-between;
    width: 100%;
    color: #fff;
    .left {
      margin-left: 12px;
      font-size: 14px;
    }
    .rigth {
      padding-top: 5px;
      height: 30px;
      line-height: 30px;
      display: flex;
      .pinjia {
        height: 30px;
        line-height: 30px;
        border: 1px solid rgb(158, 156, 156);
        border-radius: 20px;
        padding: 0px 5px;
        font-size: 18px;
      }
      span {
        margin-right: 12px;
        display: inline-block;
        transform: rotate(90deg);
      }
    }
  }
  .infoss {
    padding-top: 40px;
    height: 148px;
    display: flex;
    position: relative;
    // margin-bottom: 30px;
    .bg {
      background: url("https://p1.music.126.net/x44v5IkLN30gWgUYWYivbg==/109951164000997664.jpg?param=140y140")
        no-repeat center left;
      background-size: 10000%;
      position: absolute;
      top: 0px;
      left: 0px;
      z-index: -1;
      width: 100%;
      height: 100%;
      border-bottom-right-radius: 50% 5px;
      border-bottom-left-radius: 50% 5px;
      filter: blur(1px);
    }
    .datas {
      width: 100%;
      height: 43px;
      display: flex;
      position: relative;
      top: 93px;
      left: 0px;
      justify-content: space-between;
      .datas-left {
        margin-left: 16px;
        display: flex;
        flex-direction: column;
        .month {
          display: flex;
          .day {
            height: 26px;
            line-height: 26px;
            font-size: 26px;
            color: #fff;
            font-weight: 800;
          }
          .Luna {
            height: 26px;
            line-height: 36px;
            margin-left: 5px;
            font-size: 13px;
            color: #fff;
          }
        }
        .text {
          font-size: 12px;
          color: #f6f6f5;
        }
      }
      .datas-rigth {
        height: 10px;
        line-height: 13px;
        background-color: #a0a7a0;
        border-radius: 20px;
        padding: 6px 8px 6px 8px;
        font-size: 12px;
        color: #fff;
        margin-right: 14px;
        margin-bottom: auto;
        margin-top: auto;
      }
    }
  }
  .playerAll {
    height: 41px;
    line-height: 41px;
    display: flex;
    z-index: 20;
    background-color: #fff;
    width: 100%;
    .btn {
      margin: 13px 11px 0px 11px;
      height: 16px;
      width: 16px;
      line-height: 16px;
      background-color: #ff3a29;
      border-radius: 50%;
      color: #fff;
      text-align: center;
      font-size: 10px;
      .iconfont {
        display: inline-block;
        transform: scale(0.5);
      }
    }
    h3 {
      color: #141414;
    }
    p {
      font-size: 13px;
      color: #a3a3a3;
      line-height: 44px;
    }
  }
  .listsData {
    li {
      display: flex;
      justify-content: space-between;
      height: 60px;
      margin-left: 14px;
      .left {
        display: flex;
        .img {
          width: 40px;
          height: 40px;
          margin-right: 10px;
          img {
            width: 40px;
            height: 40px;
            border-radius: 5px;
          }
        }
        .liss {
          display: flex;
          flex-direction: column;
          .lisstop {
            font-size: 18px;
            height: 22px;
            line-height: 22px;
          }
          .lissbottom {
            display: flex;
            .spa {
              height: 18px;
              line-height: 22px;
              font-size: 12px;
              color: #ff3a29;
              margin-right: 5px;
            }
            .mim {
              font-size: 14px;
              font-weight: 300;
              height: 18px;
              line-height: 21px;
            }
          }
        }
      }
      .rigths {
        // display: inline-block;
        transform: rotate(90deg);
        margin-right: 30px;
      }
    }
  }
}
</style>